package com.dkm.biz.gl.listener;

import javax.annotation.Resource;

import org.springframework.context.ApplicationListener;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.biz.gl.domain.FromTrack;
import com.dkm.biz.gl.event.FromTrackEvent;
import com.dkm.biz.gl.persistence.entity.FromTrackPo;
import com.dkm.biz.gl.repository.FromTrackRepository;

public class FromTrackListener implements ApplicationListener<FromTrackEvent>{

	@Resource
	private FromTrackRepository fromTrackRepository;
	
	@Override
	public void onApplicationEvent(FromTrackEvent event) {
		fromTrackRepository= SpringHelper.getBean(FromTrackRepository.class);
		FromTrackPo fromTrackPo=event.getFromTrackPo();
		FromTrack fromTrack=fromTrackRepository.newInstance();
		fromTrack.setData(fromTrackPo);
		fromTrack.save();
	}

}
